<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加内容</title>
<load href="__PUBLIC__/css/bootstrap.min.css" />
<import type='css' file="css.main" />
<load href="__PUBLIC__/js/jquery-1.9.1.min.js" />
<load href="__PUBLIC__/js/jquery-ui.min.js" />
<import type='js' file="js.main" />
<import type='js' file="js.setshowflag" />
<script type="text/javascript">
$(function(){
	$("select[name='tpl']").change(function(){
		var selectedIndex = $(this).get(0).selectedIndex;
		$(".thumbpreview:eq("+selectedIndex+")").show().siblings().hide();
	})
	var template = "{$resourcearticle.tpl}";
	$("select[name='tpl'] option").each(function(index, element) {
        if($(this).val()==template){
			$(this).attr("selected","selected");
			$(".thumbpreview:eq("+(index)+")").show().siblings().hide();	
		}
    });
})
</script>
</head>

<body id="body">
<assign name='id' value="$Think.get.id" />
<div class="main-frame">
	<div class="position">华人码 > 添加资源分类</div>
	<!-- 图片资源开始 -->
	<div class="floatBackground" id="floatBackground" style="display: none;">
		<div class="bounced">
		<label class="closeImgResurces">X</label>
		<iframe id="imgResourcesiframe" src="{:rtrim(U('Upload/index'),'.html')}" width="750" height="465" frameborder="0" scrolling="auto"></iframe>
		</div>
	</div>
	<!-- 图片资源结束 -->
	<div class="addobject">
		<div class="obj-form">
			<form name="form1" id="form1" action="{:U('resourcedataedit',array('id'=>$resourcearticle['id']))}" method="post" class="form-inline">
				<ul>
					<li>
						<label class="fl tle">分类名称：</label>
						<span class="fl cnt">
						<input name="typename" class="form-control" placeholder="分类名称" value='{$resourcearticle.typename}' style="width: 450px;"><em>*</em>
						</span>
					</li>
                    <!--<li>-->
						<!--<label class="fl tle">缩略图：</label>-->
						<!--<span class="fl cnt"><input name="resimg" id="resimg" class="form-control" placeholder="缩略图" value='{$resourcearticle.resimg}' style="width: 450px;"><a class="browse" f='resimg'>浏览···</a></span>-->
					<!--</li>-->
					<!--<if condition="$resourcearticle['resimg'] neq ''">-->
					<!--<li>-->
						<!--<label class="fl tle">&nbsp;</label>-->
						<!--<span class="fl cnt"><img src="{$resourcearticle.resimg}" width="200" /></span>-->
					<!--</li>-->
					<!--</if>-->
					<li>
						<label class="fl tle">所属分类：</label>
				    	<span class="fl cnt">
					    	<select name="pid" class="form-control" style="width:200px;">
					    		<option value="0" <if condition="$resourcearticle['pid'] eq 0">selected="selected"</if>>/</option>
					    		<volist name='resourcelist' id='v'>
					    		<if condition="$v['pid'] eq 0">
					    			<option value="{$v.id}" <if condition="$v['id'] eq $resourcearticle['pid']">selected="selected"</if>>{$v['typename']}</option>
					    			<volist name='resourcelist1' id='v1' key='j'>
					    			<if condition="$v1['pid'] eq $v['id']">
					    			<option value="{$v1.id}" <if condition="$v1['id'] eq $resourcearticle['pid']">selected="selected"</if>>——{$v1['typename']}</option>
					    			</if>
					    			</volist>
					    		</if>
					    		</volist>		
					    	</select>
				    	</span>
					</li>
					<if condition="$resourcearticle['pid'] eq 0">
                    <li>
						<label class="fl tle">选择模板：</label>
				    	<span class="fl cnt">
					    	<select name="tpl" class="form-control classtype" style="width:200px;">
					    		<option value="resourcetpl1" <if condition="$resourcearticle['tpl'] eq 'resourcetpl1'">selected="selected"</if>>模板一</option>
								<option value="resourcetpl2" <if condition="$resourcearticle['tpl'] eq 'resourcetpl2'">selected="selected"</if>>模板二</option>
								<option value="resourcetpl3" <if condition="$resourcearticle['tpl'] eq 'resourcetpl3'">selected="selected"</if>>模板三</option>
								<option value="resourcetpl4" <if condition="$resourcearticle['tpl'] eq 'resourcetpl4'">selected="selected"</if>>模板四</option>		
					    	</select>
				    	</span>
					</li>
					</if>
					<li>
						<label class="fl tle">排序：</label>
						<span class="fl cnt">
						<input name="sort" class="form-control" placeholder="排序" value='{$resourcearticle.sort}' style="width: 60px;">
						</span>
					</li>
					<li class="submit">
						<label class="fl tle">&nbsp;</label>
						<span class="fl cnt"><input type="submit" value="保存修改" class="submitbtn" /></span>
					</li>
					<!--广告位管理开始-->
					<li style="height: 50px;"></li>
					<li>
						<label class="fl tle">广告位管理：</label>
						<span class="fl cnt" style="width: 800px; border:solid 1px #eee; border-radius: 5px;">
							<div class="banner" style="clear: both; width: 100%;"><iframe src="{:U('resourcebanner',array('resid'=>$resourcearticle['id']))}" frameborder="0" scrolling="auto" width="100%" height="600"></iframe></div>
						</span>
					</li>
					<!--广告位管理结束-->
				</ul>
			</form>


		</div>

		<div class="obj-previewimg">
			<div class="rotation">
				<div class="thumbpreview"><img src="__IMG__/resourcetpl/1.jpg" /></div>
				<div class="thumbpreview"><img src="__IMG__/resourcetpl/2.jpg"/></div>
				<div class="thumbpreview"><img src="__IMG__/resourcetpl/3.jpg" /></div>
				<div class="thumbpreview"><img src="__IMG__/resourcetpl/4.jpg" /></div>
			</div>
			<div class="instructions">
				<b>备注说明：</b><br>
				1、带有红色  “ * ” 项必填<br>
			</div>
		</div>
	</div>

</div>
</body>
</html>
